<?php
/*
 * Created on 04/08/2012
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<?php
/*
 * Created on 26/01/2012
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

ob_start();
	$userSession = $_SESSION["userSession"];

	// HTTP/1.1
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Cache-Control: post-check=0, pre-check=0", false);
	
	// HTTP/1.0
	header("Pragma: no-cache");
	header("Content-Type: text/html; charset=ISO-8859-1",true) ;

include "../conexao/conexao.php";
$conn =  conectar();

include "../funcoes/config.php";
$config = new config();

$q		=	strtolower ($_GET["q"]);
/*$token	=	$_GET["token"];
$id		=	$_GET["id"];*/

	//$sql = "SELECT * FROM ".$config -> tbl_gecko_produtos." WHERE codigo_produto like '%" . $q . "%' and liberado = 'S' and quantidade > 0 order by codigo_produto asc";
	$sql = "select * from ".$config -> tbl_gecko_ficha_clientes ." WHERE nome like '%" . $q . "%' order by nome asc";
	$result = mysql_query($sql) or die ("Erro". mysql_error());

if(mysql_num_rows($result) == 0){
	echo "Nenhum cliente encontrado";
	exit;
}
while($reg=mysql_fetch_array($result)){

	//if (srtpos(strtolower($reg['nom_lista']),$q !== false){
		echo $reg['id']."#".$reg['nome']."\n";
//	}
}

Desconectar($conn);
//armando.arquitetura@gmail.com
//
?>
